const AutoImport = require("unplugin-auto-import/webpack");
const Components = require("unplugin-vue-components/webpack");
const { ElementPlusResolver } = require("unplugin-vue-components/resolvers");

// 通过项目名来指定生产环境的路径
const package = require("./package.json");

module.exports = {
  // 基本路径
  publicPath: process.env.NODE_ENV === "production" ? prodUrl : "/",
  // 放置静态资源的目录
  assetsDir: "images",
  // html 的输出路径
  indexPath: "index.html",
  //文件名哈希
  filenameHashing: true,
  productionSourceMap: false,
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
  },
};
